package com.hrprojectback.service.impl.XinXiGuanLiServiceImpl;

import com.hrprojectback.dto.User;
import com.hrprojectback.mapper.UserMapper;
import com.hrprojectback.service.XinXiGuanLiService.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service

public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public int addUser(User user) {
        int i = userMapper.addUser(user);
        return i;
    }

    @Override
    public Integer getUserCounts(String username, String name) {
        Integer UserCounts = userMapper.getUserCounts(username, name);
        return UserCounts;
    }

    @Override
    public List<User> getUser(String username, String name, int pageStart, int pageSize) {
        List<User> users = userMapper.getUser(username, name, pageStart, pageSize);
        return users;
    }

    @Override
    public User getEditUser(String username) {
        User editUser = userMapper.geteditUser(username);
        return editUser;
    }

    @Override
    public int editUser(User user) {
        int i = userMapper.editUser(user);
        return i;
    }


    @Override
    public int deleteUser(String username) {
        int i = userMapper.deleteUser(username);
        return i;
    }

    @Override
    public int ShengXiao(String username) {
        int i = userMapper.ShengXiao(username);
        return i;
    }

    @Override
    public int YiShiXiAo(String username) {
        int i = userMapper.YiShiXiAo(username);
        return i;
    }

    @Override
    public int getStatus(String username) {
        int status = userMapper.getStatus(username);
        return status;
    }
}
